有关在asp网页中用"session"保存和读入用户信息的具体写法.急!!

来源:百度知道 编辑:UC知道 时间:2024/06/22 03:09:55
我是asp的初学者,想在首页中用"session"保存登陆者的信息,如"user_name",然后在其他页面中调用此信息,我不知道该如何写,试了在别的网站上找到的代码也不行,请各位高手不吝赐教,或者有别的更好的方法吗?????在下先谢了!!!!

P1.asp 中的内容如下:

<html>
<head>
<title>Session用法事</title>
</head>
<body>
<%
Dim user_name,age
user_name="卓云"
age=22
Session("user_name")=user_name
Session("age")=age
Response.Write "该程序仅用来存入Session值,请自己打开p_2.asp查看结果"
%>
</body>
</html>

P2.asp 的内容如下
<html>
<head>
<title>Session用法示例</title>
</head>
<body>
<%
Dim user_name
user_name=Session("user_name")
Response.Write user_name&"您好,欢迎您<br>"
Response.Write "您的年龄是"&Session("age")
%>
</body>
</html>

Userlogin.asp
<HTML><HEAD>
<TITLE>用户登录</TITLE>
<LINK rel="stylesheet" href="common.css&qu